package BusinessLogic;

import java.util.ArrayList;

import Data.MemberData;
import Data.MemberDataOperator;

public class DevelopMemberController implements IDevelopMemberController{
	
	private DevelopMemberModel idm = new DevelopMemberModel();
	
	public DevelopMemberModel getIDevelopMemberModel(){
		return idm;
	}
	
	public void setIDevelopMemberModel(DevelopMemberModel iDm){
		idm = iDm;
	}
	
	public DevelopMemberController(){
		idm = new DevelopMemberModel();
	}
	
	
	public MemberDataOperator getMemberDataOpeControl(){
		return null;
		
	}
	public boolean addMemberControl(int id,String name,String birthday,String sex,String contactway,double integralsum,double integralbalance){
		try{
			return idm.addMember(id, name, birthday, sex, contactway, integralsum, integralbalance);
		}catch(Exception e){
			return false;
		}
		
	}
	
	public String getreplaceStrControl(int MemberID, double integral){
		return idm.getreplaceStr(MemberID, integral);
	}
	
	public String getoldStrControl(int MemberID, double integral){
		return idm.getoldStr(MemberID, integral);
	}
	
	public boolean replaceTxtByStrControl(String oldStr,String replaceStr){
		return idm.replaceTxtByStr(oldStr, replaceStr);
	}
	
	public String getreplaceStr2Control(int MemberID, double integral){
		return idm.getreplaceStr2(MemberID, integral);
	}
	
	public String getoldStr2Control(int MemberID, double integral){
		return idm.getoldStr2(MemberID, integral);
	}
	
	public boolean replaceTxtByStr2Control(String oldStr,String replaceStr){
		return idm.replaceTxtByStr2(oldStr, replaceStr);
	}
	
	public ArrayList<MemberData> getMemberData(){
		return idm.getMemberData();
	}
	
	public MemberData getMemberDataByID(int ID){
		return idm.getMemberDataByID(ID);
	}
	
	public boolean DevelopMemberControl(){
		return idm.DevelopMember();
	}
	
	public boolean removeMemberControl(String MemberID){
		return idm.removeMember(MemberID);
	}
	
	public String getMemberNameByIDControl(int ID){
		return idm.getMemberNameByID(ID);
	}
	
	public String getMemberBirthdayByIDControl(int ID){
		return idm.getMemberBirthdayByID(ID);
	}
	
	public String getMemberSexByIDControl(int ID){
		return idm.getMemberSexByID(ID);
	}
	
	public String getMemberContactWayByIDControl(int ID){
		return idm.getMemberContactWayByID(ID);
	}
	
	public double getMemberIntegralSumByIDControl(int ID){
		return idm.getMemberIntegralSumByID(ID);
	}
	
	public double getMemberIntegralBalanceByIDControl(int ID){
		return idm.getMemberIntegralBalanceByID(ID);
	}
	
	public boolean startUpdateControl(){
	 	try{		
    		return idm.startUpdate();
    	}catch(Exception e){
    		return false;
    	}
	}

	public char[] readFile(String filename) {
		// TODO Auto-generated method stub
		return null;
	}
}
